<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>处理用户输入</title>
</head>
<body>

<div id="app-5">
    <p>{{message}}</p>
    <button v-on:click="reverseMessage">反转消息</button>
</div>

<div id="app-6">
    <p>{{message}}</p>
    <input v-model="message">
</div>

<script src="../js/vue.js"></script>
<script>

    var app6 = new Vue({
        el: '#app-6',
        data: {
            message: 'Hello Vue!'
        }
    })


    var app5 = new Vue({
        el: '#app-5',
        data: {
            message: 'Hello Vue.js!'
        },
        methods:{
            reverseMessage: function (){
                this.message = this.message.split('').reverse().join('')
            }
        }
    })
</script>
</body>
</html>